home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
rpsort.zip
/
EXAMPLES.DOC
next >
Wrap
Text File
|
1991-09-17
|
34KB
|
754 lines
September 17, 1991 RPSORT Examples Page i
Table of Contents
-----------------
Suggestion On How To Use This Document 1
General Rules For Entry Of Parameters 1
Cautionary Note On Specifying The Output File To RPSORT 1
Examples That Could Be Executed By The DOS SORT 2
1. RPSORT As A Filter 2
2. Sending Output To The Screen 2
3. Specifying A Sort Key 2
4. Reverse (Descending) Sort 2
5. Using Pipes With RPSORT. 2
Examples Of General Interest 3-8
6. Using RPSORT Not As A Filter 3
7. Fixed Length Records 3
8. Multiple Input Files 3
9. ASCII (Case Sensitive) Sort 3
10. Reverse (Descending) Sort 3
11. Reverse ASCII Sort 4
12. Specifying Key Length 4
13. Specifying Key Length But No Start Column 4
14. Multiple Sort Keys 4
15. Another Example Of Multiple Sort Keys 4
16. Sort DIR Listing With Multiple Sort Keys 5
17. Make ASCII Sequence The Default 5
18. Make Reversed (Descending) Sort The Default 5
19. Make Both ASCII And Reversed The Default 6
20. Delete Null Lines 6
21. Delete Lines/Records With Duplicate Keys 6
22. Delete Lines/Records If They Are Completely Identical 6
23. Specify Drive For Temporary Files 6
24. Ignore Ctrl-Z And Use The Entire File 7
25. Suppress Copyright And Successful Completion Messages 7
26. Put Error Messages In A File 7
27. Suppress Copyright Message And Put Error Messages In A File 7
28. Tell RPSORT To Ignore Any Ctrl-Break From The Keyboard 7
29. Expanding Tabs In A File 8
Examples Of Special Interest To Computer Programmers 9-11
30. C Language String As Sort Key 9
31. Mixing C Language Strings And Regular Strings 9
32. Turbo Pascal String As Sort Key 9
33. Mixing Turbo Pascal Strings And Regular Strings 9
34. Make C Language Strings The Default 10
35. Make Turbo Pascal Strings The Default 10
36. Signed Binary Integer As Sort Key 10
37. Turbo Pascal String And Signed Binary Integer 10
38. Unsigned Binary Integer As Sort Key 11
39. 80x87 Floating Point Number As Sort Key 11
40. BASICA & GWBASIC Floating Point Number As Sort Key 11
41. Turbo Pascal Real Number As Sort Key 11
List Of Various Compiler And Interpreter Numeric Data Types 12
September 17, 1991 RPSORT Examples Page 1
Usage: RPSORT [/Q] [/Eerrfile] [/]? [inputfile[+inputfile]]
[outputfile] [/A] [/B] [/C] [/D] [/Fnnnn] [/N] [/P]
[/R] [/Td] [/Z] [sort key defin. . .]
Sort key defin syntax: /+ [col] [:len] [A] [C] [F] [I] [M] [P] [R] [T] [U]
Suggestion On How To Use This Document
The syntax for RPSORT is simpler than the forbidding usage specification,
above, might suggest. There are three kinds of parameters:
. Filespecs. For the input to RPSORT you can have either a single
filespec or a list of filespecs separated by plus signs. For the
output only a single filespec is allowed.
. Switches. These are a slash followed by a letter indicating the type
of switch. Some switches also include a number, filespec or drive.
. Sort key definitions. These are a slash followed by a plus sign ("/+")
and one or more attributes which define a sort key.
In this document, I start with the simplest examples and build up to
examples that include several parameters. Eventually every type of
parameter that RPSORT supports appears at least once.
Many of the parameters are only described once or twice when they first
appear in examples. Though they may be used in subsequent examples they
will not be described there. Therefore, I suggest that the best idea
would be to scan the examples in order rather than skipping around to
topics of interest.
General Rules For Entry Of Parameters
. All parameters may be entered in upper or lower case as you choose. As
far as RPSORT is concerned, there is no difference.
. The parameters may be entered in any sequence except as noted in the
discussion of some RPSORT examples.
. In the commands below, I separate the parameters with spaces for clarity.
RPSORT generally accepts spaces between parameters but does not require
them except as noted in the discussion of some RPSORT examples.
Cautionary Note On Specifying The Output File To RPSORT
. If you specify a filespec, for the output, whose path and filename are
the same as that for an existing file, the latter will be replaced by the
output from RPSORT. If this is what you want, fine, but if you don't
want to lose the existing file then use a different name for the output.
September 17, 1991 RPSORT Examples Page 2
Usage: RPSORT [/Q] [/Eerrfile] [/]? [inputfile[+inputfile]]
[outputfile] [/A] [/B] [/C] [/D] [/Fnnnn] [/N] [/P]
[/R] [/Td] [/Z] [sort key defin. . .]
Sort key defin syntax: /+ [col] [:len] [A] [C] [F] [I] [M] [P] [R] [T] [U]
Examples That Could Be Executed By The DOS SORT
The first five examples are commands that could be executed by DOS SORT
but RPSORT does them much faster and can do them for much larger files.
1. RPSORT is here used as a filter which is the only option for the DOS
SORT. No sort key is defined, so the sort key is the entire line.
The default for RPSORT and the only option for the DOS SORT is that:
. The input is a text file consisting of lines each ending with a CRLF
(i.e. a carriage return and a line feed.)
. The sort key is case insensitive. Lower case letters sort equal to
upper case letters and foreign letters, punctuation and currency
symbols sort equal to their American English equivalents.
RPSORT <MYINPUT.DAT >C:\MYSORTED.DAT
2. No output file is specified, so output goes to the screen. You must
specify an input file for RPSORT. Unlike the DOS SORT, it doesn't
accept input data from the keyboard.
RPSORT <MYINPUT.DAT
3. The sort key starts at column 12 and consists of the rest of the line.
This is the only option for the DOS SORT and the default for RPSORT.
One sort key is listed which is all that the DOS SORT allows.
RPS